import { MenuProps } from 'antd';
import {
  AppstoreOutlined,
  BookOutlined,
  ContainerOutlined,
  LogoutOutlined,
  ProfileOutlined,
  ReadOutlined,
  SafetyCertificateFilled,
  SettingOutlined,
  UserAddOutlined,
  VideoCameraAddOutlined,
} from '@ant-design/icons';

export const headMenu: MenuProps['items'] = [
  {
    label: '首页',
    title: '首页',
    key: '/',
  },
  // {
  //   title: '购物车',
  //   label: '购物车',
  //   key: '/cart',
  // },
  {
    title: '动态',
    label: '动态',
    key: '/dynamic',
  },
  {
    title: '我的主页',
    label: '我的主页',
    key: '/user_page',
  },
];

export const dropdownMenu = (isAdmin: boolean) => {
  const menu: MenuProps['items'] = [
    {
      label: '个人中心',
      title: '个人中心',
      key: '/profile',
      icon: <ProfileOutlined />,
    },
    {
      title: '退出登录',
      label: '退出登录',
      key: '/logout',
      icon: <LogoutOutlined />,
    },
  ];
  isAdmin &&
    menu.push({
      title: '后台管理',
      label: '后台管理',
      key: '/admin',
      icon: <BookOutlined />,
    });
  return menu;
};

export const sideMenu: MenuProps['items'] = [
  {
    label: '个人设置',
    key: 'set',
    icon: <SettingOutlined />,
    children: [
      {
        label: '基本信息',
        title: '基本信息',
        key: '/profile/userinfo',
      },
      {
        label: '修改密码',
        key: '/profile/change_pwd',
        title: '修改密码',
      },
      {
        label: '收货地址',
        title: '收货地址',
        key: '/profile/address',
      },
    ],
  },
  {
    label: '我的店铺',
    key: 'store',
    icon: <AppstoreOutlined />,
    children: [
      {
        label: '我的出售',
        title: '我的出售',
        key: '/profile/sell',
      },
      {
        label: '收到的订单',
        title: '收到的订单',
        key: '/profile/received_orders',
      },
      {
        label: '收款账号设置',
        title: '收款账号设置',
        key: '/profile/account',
      },
      {
        label: '回复评论',
        title: '回复评论',
        key: '/profile/reply',
      },
    ],
  },
  {
    label: '订单中心',
    key: 'orders',
    icon: <ContainerOutlined />,
    children: [
      {
        label: '我的订单',
        title: '我的订单',
        key: '/profile/my_orders',
      },
      {
        label: '我的评论',
        title: '我的评论',
        key: '/profile/comment',
      },
    ],
  },
  {
    label: '关注中心',
    key: 'follow',
    icon: <BookOutlined />,
    children: [
      {
        label: '我的关注',
        title: '我的关注',
        key: '/profile/follow',
      },
      {
        label: '我的收藏',
        title: '我的收藏',
        key: '/profile/collects',
      },
      {
        label: '我的粉丝',
        title: '我的粉丝',
        key: '/profile/fans',
      },
    ],
  },
  {
    label: '我的动态',
    title: '我的动态',
    key: '/profile/my_dynamic',
    icon: <VideoCameraAddOutlined />,
  },
];

export const sideMenuAdmin: MenuProps['items'] = [
  {
    label: '用户管理',
    title: '用户管理',
    key: '/admin/user_manage',
    icon: <UserAddOutlined />,
  },
  {
    label: '分类管理',
    title: '分类管理',
    key: '/admin/category_manage',
    icon: <SafetyCertificateFilled />,
  },
  {
    label: '商品管理',
    title: '商品管理',
    key: '/admin/goods_manage',
    icon: <ReadOutlined />,
  },
  {
    label: '轮播图管理',
    title: '轮播图管理',
    key: '/admin/slide_manage',
    icon: <VideoCameraAddOutlined />,
  },
];
